package main

/*func main() {
	//创建椭圆曲线
	curve := elliptic.P256
	privateKey, err := ecdsa.GenerateKey(curve(), rand.Reader)
	if err != nil {
		log.Panic()
	}
	pubKey := privateKey.PublicKey
	data := "hello world!"
	hash := sha256.Sum256([]byte(data))
	r, s, err := ecdsa.Sign(rand.Reader, privateKey, hash[:])
	if err != nil {
		log.Panic(err)
	}
	signature := append(r.Bytes(), s.Bytes()...)
	r1 := big.Int{}
	s1 := big.Int{}
	r1.SetBytes(signature[:len(signature)/2])
	s1.SetBytes(signature[len(signature)/2:])
	res := ecdsa.Verify(&pubKey, hash[:], &r1, &s1)
	fmt.Printf("校验结果:%v\n", res)
}*/
